let mongoose  = require("mongoose");
let data = require("./data/data.json");
mongoose.connect("mongodb://127.0.0.1:27017/users",err=>{
    if(err){
        return console.log(err);
    }else{
        console.log("连接成功");
    }
})

let schema =  mongoose.Schema({
    title:String,
    content:String,
    addTime:String,
    country:String,
    type:String,
    imgUrl:String
})
let News = mongoose.model("news",schema);
// News.create(data).then(res=>{
//     console.log(res);
// })